Plot
ggplotly(CovidDeath)
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
GiniAge=readRDS(file=url(paste0(myWeb2,"GiniAndAge.rds")))
# ggplotly(GiniAge)
myWeb3="https://raw.githubusercontent.com/tianyl27/543_coursework_3/main/"
CountryMap=readRDS(file=url(paste0(myWeb3,"CountryMap.rds")))
ggplotly(CountryMap)
linkMap="https://github.com/EvansDataScience/VAforPM_Spatial/raw/main/worldMap.geojson"
library(sf)
mapWorld=read_sf(linkMap)
base=ggplot(data=mapWorld) + geom_sf(fill='grey90',
color=NA) + theme_classic()
WHRData2021
Map2021=readRDS(file=url(paste0(myWeb3,"mapWorldVars.rds")))
# leaflet
TitleText = "Country Performance in COVID epidemic"
CaptionText = "Source: https://worldhappiness.report/ed/2021/"
theLegTitle="World_Performance\n(grey is missing)"
clusterMap= base + geom_sf(data=Map2021,
aes(fill=cluster,text=NAME),
color=NA)
Warning: Ignoring unknown aesthetics: text
clusterMap = clusterMap+ scale_fill_brewer(palette ='BuGn',
direction = -1,
name=theLegTitle)+ labs(title=TitleText,
caption=CaptionText) +
theme(plot.title = element_text(hjust = 1),
plot.caption = element_text(hjust = 0))
# palette ='BuGn'
# Next: change the color
# How to get rid of the axis
clusterMap%>%ggplotly()